package sn.gandal.mobile.kalpet.server.dto;

import sn.gandal.mobile.kalpet.data.entities.Account;

public class AuthDTO {
public String nom;
public String codeRetour;
public String idExterne;
public String prenom;
public String sexe;
public String adresse;
public String tel;
public String cni;
public Boolean compteActif;
public String numeroClient;
public String dateCreated;
public CompteCreditDTO compteCredit;
public CompteCouponDTO compteCoupon;

public AuthDTO(String nom, String codeRetour, String prenom, String sexe,
		String adresse, String tel, String cni, Boolean compteActif,
		String numeroClient, String dateCreated, CompteCreditDTO compte, CompteCouponDTO coupon) {
	super();
	this.nom = nom;
	this.codeRetour = codeRetour;
	this.prenom = prenom;
	this.sexe = sexe;
	this.adresse = adresse;
	this.tel = tel;
	this.cni = cni;
	this.compteActif = compteActif;
	this.numeroClient = numeroClient;
	this.dateCreated = dateCreated;
	this.compteCredit = compte;
	this.compteCoupon=coupon;
}
public AuthDTO() {
	super();
	// TODO Auto-generated constructor stub
}
public String getNom() {
	return nom;
}
public void setNom(String nom) {
	this.nom = nom;
}
public String getCodeRetour() {
	return codeRetour;
}
public void setCodeRetour(String codeRetour) {
	this.codeRetour = codeRetour;
}
public String getPrenom() {
	return prenom;
}
public void setPrenom(String prenom) {
	this.prenom = prenom;
}
public String getSexe() {
	return sexe;
}
public void setSexe(String sexe) {
	this.sexe = sexe;
}
public String getAdresse() {
	return adresse;
}
public void setAdresse(String adresse) {
	this.adresse = adresse;
}
public String getTel() {
	return tel;
}
public void setTel(String tel) {
	this.tel = tel;
}
public String getCni() {
	return cni;
}
public void setCni(String cni) {
	this.cni = cni;
}
public Boolean getCompteActif() {
	return compteActif;
}
public void setCompteActif(Boolean compteActif) {
	this.compteActif = compteActif;
}
public String getNumeroClient() {
	return numeroClient;
}
public void setNumeroClient(String numeroClient) {
	this.numeroClient = numeroClient;
}
public String getDateCreated() {
	return dateCreated;
}
public void setDateCreated(String dateCreated) {
	this.dateCreated = dateCreated;
}
public CompteCreditDTO getCompteCredit() {
	return compteCredit;
}
public void setCompteCredit(CompteCreditDTO compte) {
	this.compteCredit = compte;
}

public CompteCouponDTO getCompteCoupon() {
	return compteCoupon;
}
public void setCompteCoupon(CompteCouponDTO coupon) {
	this.compteCoupon = coupon;
}

@Override
public String toString() {
	return "AuthDTO [nom=" + nom + ", codeRetour=" + codeRetour + ", prenom="
			+ prenom + ", sexe=" + sexe + ", adresse=" + adresse + ", tel="
			+ tel + ", cni=" + cni + ", compteActif=" + compteActif
			+ ", numeroClient=" + numeroClient + ", dateCreated=" + dateCreated
			+ " "+ compteCredit.toString()+" "+ compteCoupon.toString() +"]";
}

public Account extractAccount(){
	Account account=new Account();
	account.setIdExterne(this.idExterne);
	account.setAdresse(this.adresse);
	account.setNom(this.nom);
	account.setPrenom(this.prenom);
	account.setSexe(this.sexe);
	account.setTel(this.tel);
	account.setEnabled(this.compteActif);
	account.setType("GP");
	account.setCni(this.cni);
	return account;
}
public String getIdExterne() {
	return idExterne;
}
public void setIdExterne(String idExterne) {
	this.idExterne = idExterne;
}


}
